﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ImageTagToolViewModel.Others
{
    /// <summary>
    /// The class is responsible for managing the search
    /// </summary>
    class SearchProvider
    {
        /// <summary>
        /// This function manages the search
        /// </summary>
        /// <param name="word">the search term</param>
        /// <returns>returns a list containing the image IDs</returns>
        public List<String> Search(String word)
        {
            List<String> actors;
            List<String> location;
            List<String> date;
            List<String> description;
            actors = SearchForActors(word);
            location = SearchForLocation(word);
            date = SearchForDate(word);
            description = SearchForDescription(word);
            List<String> images = actors.Union(location).Union(date).Union(description).ToList();
            return images;
        }

        /// <summary>
        /// This function is looking for actors.
        /// </summary>
        /// <param name="word">the search term</param>
        /// <returns>returns a list containing the image IDs</returns>
        private List<String> SearchForActors(String word) 
        {
            List<String> images = null;
            //get the list from database
            return images;
        }

        /// <summary>
        /// This function is looking for location.
        /// </summary>
        /// <param name="word">the search term</param>
        /// <returns>returns a list containing the image IDs</returns>
        private List<String> SearchForLocation(String word)
        {
            List<String> images = null;
            //get the list from database
            return images;
        }

        /// <summary>
        /// This function is looking for date.
        /// </summary>
        /// <param name="word">the search term</param>
        /// <returns>returns a list containing the image IDs</returns>
        private List<String> SearchForDate(String word)
        {
            List<String> images = null;
            //get the list from database
            return images;
        }

        /// <summary>
        /// This function is looking for description.
        /// </summary>
        /// <param name="word">the search term</param>
        /// <returns>returns a list containing the image IDs</returns>
        private List<String> SearchForDescription(String word)
        {
            List<String> images = null;
            //get the list from database
            return images;
        }
    }
}
